﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="RealEstate.Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <script type="text/javascript">
        function RowSelected(sender, args) {
            alert("Selected: " + args.getDataKeyValue("TransactionId"));
        }
        function RowDblClick(sender, args) {
            window.location = "/Views/Transaction/TranDetails.aspx?id=" + args.getDataKeyValue("TransactionId");
        }
    </script>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <Scripts>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                </Scripts>
            </telerik:RadScriptManager>
    <asp:LoginView ID="LoginView1" runat="server">
        <AnonymousTemplate>
            <%Response.Redirect("~/Views/Account/Login.aspx"); %>
        </AnonymousTemplate>
        <LoggedInTemplate>
            <%if (Roles.IsUserInRole("admin"))
              {
            %>
            <p>
                <a href="Views/Transaction/ByREStatus.aspx" title="Real Estate Website">Real Estate Transaction</a>.
            </p>
            <%
              }
              else
              {
            %>
            
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Web20">
            </telerik:RadSkinManager>
            <div>
            </div>
            <telerik:RadGrid ID="radTableTransaction" runat="server" PageSize="15" AllowSorting="False"
                AllowPaging="True" ShowGroupPanel="False" AutoGenerateColumns="False" GridLines="None">
                <PagerStyle Mode="NumericPages"></PagerStyle>
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                    <ClientEvents OnRowDblClick="RowDblClick" />
                </ClientSettings>
                <MasterTableView Width="100%" ClientDataKeyNames="TransactionId" ShowFooter="True"
                    GroupLoadMode="Client">
                    <Columns>
                        <telerik:GridBoundColumn SortExpression="ClientCoClientName" HeaderText="Client's and Co Cclient's Name"
                            HeaderButtonType="TextButton" DataField="ClientCoClientName" UniqueName="ClientCoClientName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="HomePhone" HeaderText="Home Phone" HeaderButtonType="TextButton"
                            DataField="HomePhone" UniqueName="HomePhone" DataFormatString="{0:###-###-####}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="CellPhoneNumber" HeaderText="Cell Phone"
                            HeaderButtonType="TextButton" DataField="HomePhone" UniqueName="CellPhoneNumber"
                            DataFormatString="{0:###-###-####}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="Previous Program" HeaderText="Previous Program"
                            HeaderButtonType="TextButton" DataField="PreviousProgram" UniqueName="PreviousProgram">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="TargetProgram" HeaderText="Target Program"
                            HeaderButtonType="TextButton" DataField="TargetProgram" UniqueName="TargetProgram"
                            DataFormatString="{0}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="LockedProgram" HeaderText="Locked Program"
                            HeaderButtonType="TextButton" DataField="LockedProgram" UniqueName="LockedProgram"
                            DataFormatString="{0}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="DateOfCOE" HeaderText="Date To Be COE" HeaderButtonType="TextButton"
                            DataField="DateOfCOE" UniqueName="DateOfCOE" DataFormatString="{0}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="RefferedBy" HeaderText="Refered By" HeaderButtonType="TextButton"
                            DataField="RefferedBy" UniqueName="RefferedBy" DataFormatString="{0}">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
            <%
              }
            %>
        </LoggedInTemplate>
    </asp:LoginView>
</asp:Content>
